package PTA_JAVA.JavaA.Javademo23;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double[] arr = new double[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextDouble();
        }
        System.out.println(ArrayUtils.findMinMax(arr));
        System.out.println(ArrayUtils.PairResult.class);
    }
}
class ArrayUtils{
    static class PairResult{
        private double min;
        private double max;

        public double getMin() {
            return min;
        }

        public void setMin(double min) {
            this.min = min;
        }

        public double getMax() {
            return max;
        }

        public void setMax(double max) {
            this.max = max;
        }

        @Override
        public String toString() {
            return "PairResult [" +
                    "min=" + min +
                    ", max=" + max +
                    "]";
        }
    }
    static PairResult findMinMax(double[] values){
        PairResult p=new PairResult();
        p.setMax(Arrays.stream(values).max().getAsDouble());
        p.setMin(Arrays.stream(values).min().getAsDouble());
        return p;
    }
}
